<?php
function _json($code, $message, $arr = [])
{
    $content = [
        'code' => $code,
        'message' => $message,
        'data' => $arr,
    ];
    return json_encode($content);
}

$arr = [
    'name' => 'eric',
    'age' => 20,
    'tech'=>[
        'php',
        'css',
        'html'
    ]
];
echo _json(200, '成功',$arr);








